<?php     

    
    $parent = 'opeingresos';
    //variable de envio de informacion al menu Usuario ID
    $responseId         = $idUser;
    $idUser             = "idUser=".$idUser."&parent=".$parent;
    
    
    //Variable de la pagina
    $urlPage            = "Detalle";
    
    //Url de Actualizacion de Cliente Dashbioard
    $urlLoadUser        = "LoadUser('".url_for("opeingresos/".$parent)."','".$idUser."','#User".$responseId."');";
    //Url de Actualizacion de Cliente Dashbioard / Cierre Ventana
    $urlLoadUserClose   = "javascritp:".$urlLoadUser."MenuClose();";
    
    
        
    function fechaHora($fecha)
            
{  
    
            $meses = array('','Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic');
            list($ano,$mes,$dia)= explode("-", $fecha);
            $valor = explode(" ", $dia);
            $dia =  $valor[0];            
              $nueva =  mktime(0,0,0, $mes,$dia,$ano);
              $nuevafecha=date("d-",$nueva).$meses[intval(date("m",$nueva))].date("-Y",$nueva).' a las '.date("g:i a",strtotime($valor[1]));
            
      return ($nuevafecha);  
            
}
    
    function fechaCalendarioF($fecha)
            
    {  
            list($ano,$mes,$dia)= explode("-", $fecha);
            $valor = explode(" ", $dia);
            $dia =  $valor[0];            
              $nueva =  mktime(0,0,0, $mes,$dia,$ano);
              $nuevafecha=date("d/m/Y",$nueva);
            
      return ($nuevafecha);  
            
    }
    
    /*FUNCION sum de los intervalos de tiempo a la hora inicial*/
    function HorarioSum($hora, $tipoHora, $ind = '', $intervalo = 0){
        
        $hora = explode(":",$hora);
        $hora = date("$tipoHora:i$ind" , mktime($hora[0],$hora[1]+$intervalo));
        $hora = explode(":",$hora);
                if($hora[0]<=9) $hora[0] = "0".intval($hora[0]);
        $hora = $hora[0].":".$hora[1];
        
        return $hora;

    }
    
 
?>



            


<form class="filtroRangos" id="myForm<?php echo $urlPage; ?>" action="<?php echo url_for('opeingresos/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="tableRango">
    <tr>
        <td>
            <div class="title-windows">Modificar el ingreso
            
                <a href="javascript:void(0);" onclick="<?php echo $urlLoadUserClose; ?>" class="close-windows">
                    
                <img src="/images/icon/remove.png" title="Close"  />
                
                </a>
            </div>
        </td>
    </tr>
    <tr>
        <td class="" style="vertical-align:top; padding: 10px;">
            

        <?php if (!$form->getObject()->isNew()): ?>
        <input type="hidden" name="sf_method" value="put" />
        <?php endif; ?>
        
        
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
      
      <tr>
          <td class="form-field" style="padding-top: 0px; margin-top: 0px;">
             
            <?php echo $form->renderGlobalErrors() ?>

            <?php echo $form['pago_id']->renderLabel() ?>
            <?php echo $form['pago_id']->renderError() ?>
              <div class="clear"></div>
            <?php echo $form['pago_id'] ?>
            <div class="clear" style="height: 10px"></div>
            
            <?php echo $form['monto']->renderLabel() ?> 
            <?php echo $form['monto']->renderError() ?>
              <div class="clear"></div>
            <?php echo $form['monto'] ?>
              
            
          
          </td>
      </tr>    
          
      
  </table>


</td>
    </tr>
        <tr><td class="form-action-bottom">
            <!--Campo Oculto de evio de variable de ID del usuario-->
            <input type="hidden" name="idUser" value='<?php echo $responseId ?>'/>
            <input type="hidden" name="parent" value='<?php echo $parent ?>'/>
              
          
          <?php echo $form->renderHiddenFields(false) ?>
          <input class="button-submit" type="submit" value="Modificar"  id="submit"/>
          <a class="button-done" href="javascript:void(0);" onclick="<?php echo $urlLoadUserClose; ?>">Cerrar</a>
    
        </td></tr>

    
  </table>


</form>   
         

<script type="text/javascript">
    
   
 $('#saldo_temporal_operador_id').val('<?php echo $operador_id?>');
   
   
// prepare tde form when tde DOM is ready
$(document).ready(function() {
    var options = {
        target:        '#slideDer-intConten',   // target element(s) to be updated witd server response
        beforeSubmit:  showRequest,  // pre-submit callback
        success:       showResponse,  // post-submit callback
        type: 'post'       // 'get' or 'post', override for form's 'method' attribute

    };

    // bind form using 'ajaxForm'
    $('#myForm<?php echo $urlPage; ?>').ajaxForm(options);
});

// pre-submit callback
function showRequest(formData, jqForm, options) {
    // formData is an array; here we use $.param to convert it to a string to display it
    // but tde form plugin does tdis for you automatically when it submits tde data
    var queryString = $.param(formData);
    // here we could return false to prevent tde form from being submitted;
    // returning anytding otder tdan false will allow tde form submit to continue
    return true;
}

// post-submit callback
function showResponse(responseText, statusText, xhr, $form)  {
    
       closeAll();    
     
}



</script>
